<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--> <html lang="en" class="no-js"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title>{$Think.lang.mtx_page_title} - {$Think.lang.cfg_website}</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<!-- BEGIN GLOBAL MANDATORY STYLES -->
	<link href="{$NOW_THEME_URL}/Assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/plugins/bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style-metro.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/style-responsive.css" rel="stylesheet" type="text/css"/>
	<link href="{$NOW_THEME_URL}/Assets/css/themes/{:session('skin')}.css" rel="stylesheet" type="text/css" id="style_color"/>
	<!-- END GLOBAL MANDATORY STYLES -->
	<!-- BEGIN PAGE LEVEL STYLES -->
    <link href="{$NOW_THEME_URL}/Assets/plugins/qqface/a.css" rel="stylesheet" type="text/css"/>
	<!-- END PAGE LEVEL STYLES -->
	<link rel="shortcut icon" href="favicon.ico" />
    <style type="text/css">
		.qqFace {
			background-color:#FFF;
			padding:5px;
			border:#CCC 1px solid;
		}
		.addlink {
			background-color:#FFF;
			padding:5px;
			border:#CCC 1px solid;
			display:none;
			position:absolute;
			width:246px;
			height:120px;
			line-height:30px;
			text-align:center;
		}
	</style>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed">
	<!-- BEGIN HEADER -->
	<include file="Public:header" />
	<!-- END HEADER -->
	<!-- BEGIN CONTAINER -->
	<div class="page-container">
		<!-- BEGIN SIDEBAR -->
		<div class="page-sidebar nav-collapse collapse">
			<!-- BEGIN SIDEBAR MENU -->        
			<ul class="page-sidebar-menu">
            	<li>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
					<div class="sidebar-toggler hidden-phone"></div>
					<!-- BEGIN SIDEBAR TOGGLER BUTTON -->
				</li>
                {$menu_tree}
            </ul>
			<!-- END SIDEBAR MENU -->
		</div>
		<!-- END SIDEBAR -->
		<!-- BEGIN PAGE -->
		<div class="page-content">
			<!-- BEGIN SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<div id="portlet-config" class="modal hide">
				<div class="modal-header">
					<button data-dismiss="modal" class="close" type="button"></button>
					<h3>portlet Settings</h3>
				</div>
				<div class="modal-body">
					<p>Here will be a configuration form</p>
				</div>
			</div>
			<!-- END SAMPLE PORTLET CONFIGURATION MODAL FORM-->
			<!-- BEGIN PAGE CONTAINER-->        
			<div class="container-fluid">
				<!-- BEGIN PAGE HEADER-->
				<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN PAGE TITLE & BREADCRUMB-->
						<div class="clear">&nbsp;</div>
						<ul class="breadcrumb">
							<li>
								<i class="icon-home"></i>
								<a href="__APP__">{$Think.lang.cfg_page_home}</a> 
								<span class="icon-angle-right"></span>
							</li>
							<li>
								<a href="__URL__">{$Think.lang.mtx_page_title}</a> 
								<span class="icon-angle-right"></span>
						  </li>
						</ul>
						<!-- END PAGE TITLE & BREADCRUMB-->
					</div>
				</div>
				<!-- END PAGE HEADER-->
				<!-- BEGIN PAGE CONTENT-->
				<div class="row-fluid">
					<div class="span12">
						<!-- BEGIN VALIDATION STATES-->
						<div class="portlet box purple">
							<div class="portlet-title">
								<div class="caption"><i class="icon-plus"></i>{$Think.lang.mtx_page_add_title}</div>
								<div class="tools">
									<a href="javascript:;" class="collapse"></a>
								</div>
							</div>
							<div class="portlet-body form">
                            <!-- BEGIN FORM-->
								<form action="__URL__/add" method="post" id="adcontentForm" 
                                 class="form-horizontal form-bordered form-row-stripped">
                                 <input type="hidden" name="solevar" value="{:create_id()}"/>
									<div class="alert alert-error hide">
										<button class="close" data-dismiss="alert"></button>
										{$Think.lang.cfg_form_err_allform}
									</div>
									<div class="alert alert-success hide">
										<button class="close" data-dismiss="alert"></button>
										{$Think.lang.cfg_form_ok_allform}
									</div>
                                    <div class="tabbable tabbable-custom">
                                        <ul class="nav nav-tabs">
                                            <li class="active">
                                                <a href="#tab_1_1" data-toggle="tab">
                                                    {$Think.lang.mtx_form_tab_content}
                                                </a>
                                            </li>
                                            {$arg|formReplyTab=###}
                                        </ul>
                                        <div class="tab-content">
<!--tab1 start-->
<div class="tab-pane active" id="tab_1_1">      
    {$arg|eleSiteShow=###}<!--多站点支持-->
	{$arg|eleDeviceShow=###}<!--多终端支持-->
	{$lang|eleLangShow=###}<!--多语言支持-->
      
    <div class="control-group">
      <label class="control-label">{$Think.lang.mtx_form_ele_title}
      <span class="required">*</span></label>
      <div class="controls">
          <input type="text" name="title" data-required="1" class="span6 m-wrap"
          value="{$rows.title}"/>
      </div>
    </div>
    
    <div class="control-group">
        <label class="control-label">{$Think.lang.mtx_form_ele_description}
        <span class="required">*</span></label>
        <div class="controls" style="position:relative;">
            <button type="button" class="btn blue" id="showFace">
              <i class="icon-magnet"></i>
              {$Think.lang.mtx_form_ele_face}
            </button>
            <button type="button" class="btn blue" id="showLink">
              <i class="icon-link"></i>
             {$Think.lang.mtx_form_ele_link}
            </button>
            <div class="addlink">
            	<p>
                	<input type="text" name="link_href" data-required="1"  placeholder="{$Think.lang.mtx_form_ele_linkaddr}"/>
                </p>
                <p>
                	<input type="text" name="link_name" data-required="1" placeholder="{$Think.lang.mtx_form_ele_linktext}"/>
                </p>
                <p>
                	<button type="button" id="showLink_btn" class="btn mini blue">
                    {$Think.lang.mtx_form_ele_ok}</button> 
                    <button type="button" id="showLink_cbtn" class="btn mini red">
                    {$Think.lang.mtx_form_ele_no}</button>
                </p>
            </div>                              
            <div class="clear" style="height:10px;"></div>
            <textarea rows="12" name="description" id="content" 
            class="large m-wrap">{$rows['value']}</textarea>
      	</div>
    </div>
</div>
<!--tab1 end-->
<!--tab2 start-->
{$arg|formReplyEle=###}
<!--tab2 end-->
                                        </div>
                                    </div>
									<div class="form-actions">
										<button type="submit" class="btn purple">{$Think.lang.cfg_form_ele_submit}</button>
										<button type="reset" class="btn">{$Think.lang.cfg_form_ele_reset}</button>
									</div>
								</form>
								<!-- END FORM-->
							</div>
						</div>
						<!-- END VALIDATION STATES-->
					</div>
				</div>			
				<!-- END PAGE CONTENT-->
			</div>
			<!-- END PAGE CONTAINER-->
		</div>
		<!-- END PAGE -->
	</div>
	<!-- END CONTAINER -->
	<!-- BEGIN FOOTER -->
    <include file="Public:footer" />
	<!-- END FOOTER -->
	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
	<!-- BEGIN CORE PLUGINS -->
	<script src="__PUBLIC__/Js/jquery.min.js" type="text/javascript"></script>
	<script src="{$NOW_THEME_URL}/Assets/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>   
	<script src="{$NOW_THEME_URL}/Assets/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
	<!--[if lt IE 9]>
	<script src="{$NOW_THEME_URL}/Assets/plugins/excanvas.min.js"></script>
	<script src="{$NOW_THEME_URL}/Assets/plugins/respond.min.js"></script>  
	<![endif]-->  
	<script src="{$NOW_THEME_URL}/Assets/plugins/jquery.cookie.min.js" type="text/javascript"></script>
	<!-- END CORE PLUGINS -->
    <!-- BEGIN ARTDIALOG-->
    <script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/artdialog/jquery.artdialog.js?skin=bootstrap"></script>
	<script type="text/javascript" src="{$NOW_THEME_URL}/Assets/plugins/artdialog/plugins/iframeTools.js"></script>
    <!-- END ARTDIALOG-->
	<!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="{$NOW_THEME_URL}/Assets/plugins/qqface/jquery.shortcuts.js" type="text/javascript"></script>
    <script src="{$NOW_THEME_URL}/Assets/plugins/qqface/qqFace.js" type="text/javascript"></script>
	<!-- END PAGE LEVEL PLUGINS -->
	<!-- BEGIN PAGE LEVEL SCRIPTS -->
	<script src="{$NOW_THEME_URL}/Assets/scripts/app.js"></script>
	<script type="text/javascript">
		var ABS_URL_Theme = "{$NOW_THEME_URL}/";
		var ABS_URL_Module = "__URL__";
		var list_itf = {};

		var lang = "{:getLang()}";
		jQuery(document).ready(function() {       
			App.init();
			   
			$('#showFace').qqFace({
				assign:'content', //给那个控件赋值
			}); //表情
			$('#showLink').click(function(e){
				var offset = $(this).position();
				var top = offset.top + $(this).outerHeight();
				$(".addlink").css('top',top);
				$(".addlink").css('left',offset.left);
				$(".addlink").show();
				
				e.stopPropagation();
			});
			
			$('#showLink_btn').click(function(){
				var txt  = $("input[name='link_name']").val()
				var href = $("input[name='link_href']").val()
				if(href == ''){
					alert('<?=L("mtx_form_validata_url_req")?>')
				}else if(!href.match('^((https|http|ftp|rtsp|mms)?://)')){
					alert('<?=L("mtx_form_validata_url_regex")?>')
				}else{
					if(txt == '') txt = href;
					var url = "<a href=\""+href+"\">"+txt+"<\/a>";
					$("#content").insertContent($("#content").selectionRange()+url);
				}
				
				$(".addlink").hide();
			});
			$('#showLink_cbtn').click(function(){
				$(".addlink").hide();
			});
			$('#content').on('focusin',function(){
				$(".addlink").hide();
			});
			
			
		});
	</script>
	{$arg|formReplyJs=###}
	<!-- END JAVASCRIPTS -->   
</body>
<!-- END BODY -->
</html>